//***************************************************************************
//*
//*	File:			dswl_configurations.h
//*	Description:	Wrapper for IConfigurations interface
//*
//***************************************************************************
//*
//*	Note:			This source code is provided "as is" meaning that you may 
//*					use it at your own risk. 
//*					You are free to use it in any way you like.
//*
//***************************************************************************
//*
//*	History:		
//*
//*	-------------------------------------------------------------------------
//*	2003/07/27	|	Initial release									|	rk
//*	-------------------------------------------------------------------------
//*
//***************************************************************************

//
//-------------------------------------------------------------- PREPROCESSOR 
//

#ifndef			_DSWL_CONFIGURATIONS_H_INCLUDED
#define			_DSWL_CONFIGURATIONS_H_INCLUDED

#if				_MSC_VER > 1000
#pragma once
#ifdef			__SWITCH_SHOW_HEADER
#pragma message ("-- dswl_configurations.h\n")
#endif
#ifdef			__SWITCH_SHOW_HEADER_TREE
#pragma message ("-- "__FILE__"\n")
#endif
#endif 

#ifdef			_DSWL_SWITCH_USE_AUTOCAST
#ifdef			_DSWL_SWITCH_USE_UNSAFE_AUTOCAST
#pragma	message ( "-- dswl_configurations.h \t Warning: Generating auto-cast operator: CIConfigurations::operator IConfigurations* () const" )
#else
#pragma	message ( "-- dswl_configurations.h \t Warning: Generating auto-cast operator: CIConfigurations::operator       IConfigurations* ()" )
#pragma	message ( "-- dswl_configurations.h \t Warning: Generating auto-cast operator: CIConfigurations::operator const IConfigurations* () const" )
#endif
#endif

//
//-------------------------------------------------------------- DEPENDENCIES
//

//
//------------------------------------------------------ FORWARD DECLARATIONS
//

class			CIApplication	;
class			CIConfiguration	;

//
//--------------------------------------------------------- CLASS DECLARATION
//

//***************************************************************************
//**	@DOC		CLASS CIConfigurations
//***************************************************************************
//*		@CLASS		Wrapper for IConfigurations interface
//***************************************************************************
class _DSWL_EXT_CLASS CIConfigurations  
{
	//																								
	//-----------------------------------------------------------------------						
	//***************************     ATTRIBS     ***************************						
	//-----------------------------------------------------------------------						
	//																								
private:																											// @ACCESS	Private Attributes	
			CComPtr< IConfigurations >	m_pIConfigurations	;														// @CMEMBER	Smart pointer to the actual text configuration interface
																											
	//																														
	//-----------------------------------------------------------------------												
	//*************************     PROPERTIES     **************************						
	//-----------------------------------------------------------------------												
	//																														
public:																												// @ACCESS	Public Property Methods
			CIApplication				GetApplication		( void )									const	;	// @CMEMBER	Returns the application the configurations belong to
			long						GetCount			( void )									const	;	// @CMEMBER	Returns the number of configurations in the container
										
	//																													
	//-----------------------------------------------------------------------											
	//*************************     INFORMATION     *************************						
	//-----------------------------------------------------------------------											
	//																													
public:																												// @ACCESS	Public Information Methods
			BOOL						IsNull				( void )									const	;	// @CMEMBER	Determines whether the internal pointer is <t NULL>
			BOOL						IsValid				( void )									const	;	// @CMEMBER	Determines whether the internal pointer differs from <t NULL>
																										
	//																											
	//-----------------------------------------------------------------------									
	//*********************     ELEMENT MANAGEMENT     **********************
	//-----------------------------------------------------------------------									
	//																											
public:																												// @ACCESS	Public Configuration Management Methods
			CIConfiguration				GetAt				(		long				a_lIndex	)	const	;	// @CMEMBER	Determines the item at specified 0-based index. 
			CIConfiguration				GetItem				(		long				a_lItem		)	const	;	// @CMEMBER	Determines the item at specified 1-based index. 

	//																									
	//-----------------------------------------------------------------------							
	//**************************     OPERATORS     **************************							
	//-----------------------------------------------------------------------							
	//																									
public:																												// @ACCESS	Public Operators
			bool						operator	==		( const CIConfigurations&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool						operator	!=		( const CIConfigurations&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool						operator	<=		( const CIConfigurations&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool						operator	>=		( const CIConfigurations&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool						operator	<		( const CIConfigurations&	a_Other		)	const	;	// @CMEMBER	Comparison operator
			bool						operator	>		( const CIConfigurations&	a_Other		)	const	;	// @CMEMBER	Comparison operator
																									
			CIConfigurations&			operator	=		(		IConfigurations*	a_pIOther	)			;	// @CMEMBER	Copy operator
																									
			IConfigurations*			operator	*		( void )											;	// @CMEMBER	Dereference operator
	const	IConfigurations*			operator	*		( void )									const	;	// @CMEMBER	Dereference operator
																									
			IConfigurations*			operator	->		( void )											;	// @CMEMBER	Member access operator
	const	IConfigurations*			operator	->		( void )									const	;	// @CMEMBER	Member access operator

			CIConfiguration				operator	[]		(		int					a_iIndex	)	const	;	// @CMEMBER	Subscription operator
																									
	#ifdef	_DSWL_SWITCH_USE_AUTOCAST																
	#ifdef	_DSWL_SWITCH_USE_UNSAFE_AUTOCAST														
										operator			IConfigurations*	( void )				const	;	// @CMEMBER	TypeCast operator
	#else																								
										operator			IConfigurations*	( void )						;	// @CMEMBER	TypeCast operator
										operator	const	IConfigurations*	( void )				const	;	// @CMEMBER	TypeCast operator
	#endif																							
	#endif							
									
	//																								
	//-----------------------------------------------------------------------						
	//***********************     CON/DESTRUCTION     ***********************						
	//-----------------------------------------------------------------------						
	//																								
public:																												// @ACCESS	Public Con-/Destruction Methods	
			 CIConfigurations( IConfigurations* a_pIConfigurations = NULL );										// @CMEMBER	Default constructor
	virtual ~CIConfigurations();																					// @CMEMBER	Default destructor
};
//***************************************************************************
//**	@END
//***************************************************************************

#endif		// _DSWL_CONFIGURATIONS_H_INCLUDED
